home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-30 | 3.3 KB | 115 lines | [TEXT/MPS ] |
- //
- // "Rsrc Compare Proc.r"
- //
- // This script is set up to use a custom version proc to determine whether
- // or not to replace/update an existing resource.
- // This is the recommended way of determining whether or not to update an
- // existing resource which has a version number somewhere in the resource header.
-
- // If the correct flags are set, Installer will call the custom proc, which should
- // use the call back routine ReadTargetData to obtain the resource version.
-
- // The following flags must be set:
- // copy, leaveAloneIfNewer, & update existing.
- // also the 'inra' must have the source version hard-coded.
-
- // In this example, the resource will be copied the first time only.
- // The update will NOT happen, since the custom proc will return the
- // first long of the resource, which is “0x0A760000”, and
- // the version in the 'inra' below is “0x0A75ffff”.
-
- #include "InstallerTypes.r"
-
- include "GetRsrcVersion";
-
- resource 'inpk' (100) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "Copy Example File from Tidbits Disk....",
- { 'inra', 1000 },
- }
- };
-
- resource 'inra' (1000) {
- format1 {
- deleteWhenRemoving,
- deleteWhenInstalling,
- copy, // Copy on Install
- leaveAloneIfNewer, // Do not update a newer file
- noTgtRequired,
- updateExisting, // Update an existing file
- copyIfNewOrUpdate,
- ignoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
- 0,
- 10000,
- 'PICT',
- 1000,
- 0x0,
- "Fubar Pict",
- { 20000, 'PICT', 1000, 0, "WhatEver" },
- 0x0A75ffff, // The “dummy” source version number (first long from resource)
- 128, // MUST be the 'invc' id of the custom version proc
- 0,
- "Example File - PICT"
- }
- };
-
- resource 'invc' (128) {
- format0 {
- 'infn', // The resource type of the actual custom proc
- 128, // The resource id of the actual custom proc
- 1024, // The minimum amount of memory needed by the proc
- "Returns the first long from the target resource.", // Will return “0x0A760000”
- }
- };
-
- // NOTE: When a target spec is called from within a resource atom of
- // any kind ( 'inra', 'inrm', 'inr#' ), the type, creator, dates and
- // Finder attributes fields will only apply when creating a new file.
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator than those specified
- // below will not be updated.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- 'rsrc', // TYPE for new file
- 'RSED', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- ":Example File - PICT" // path to target file
- }
- };
-
- resource 'infs' (20000) {
- 'ttro',
- 'ttxt',
- 0x1, // ScriptCheck sets date
- noSearchForFile,
- TypeCrMustMatch,
- "Tidbits:Example File" // Tidbits folder
- };
-